<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const ar = ["css", "js", "html"];
      function find(arr, fn) {
        for (let i = 0; i < arr.length; i++) {
          if (fn(arr[i], i, arr)) {
            return arr[i];
          }
        }
      }
      const r = find(ar, (v, i, arr) => {
        return v.startsWith("c");
      });
      console.log(r);
    </script>
  </body>
</html>
